/**
 * Created by CodeTlan.
 * User: Ing. Miguel Salas
 * Date: 3/11/12
 * Time: 5:00 PM
 */
Ext.define('CT.view.usuario.Grid', {
    extend: 'Ctc.view.EditorGrid',
    alias:"widget.griduser",
    store:'Users',
    requires:'Ext.ux.grid.checkcolumn.CheckColumn',
    buildColumns: function(){
        Ext.define('comborolgrid',{
            extend:'CT.view.rol.Combo',
            alias:'widget.comborolgrid',
            valueField:'titulo'
        });
        return [
            { xtype: 'rownumberer'},
            { header: 'Usuario',  dataIndex: 'usuario_k', flex:1 },
            { header: 'Nombre', dataIndex: 'nombre', flex:1, editor: { maxLength:200,  allowBlank: false }},
            { header: 'Apellidos', dataIndex: 'apellidos', flex:1, editor: { maxLength:200, allowBlank: false } },
            { header: 'Rol', dataIndex: 'rol', flex:1, editor: 'comborolgrid' },
            { width:40, align:'center', dataIndex: 'activo',  xtype:'checkcolumn'}
        ];
    },
    _buildEditor:function(){
        return {
            allowBlank:false
        };
    },
    buildTbar:function(){
        return [{
            xtype:'button',
            itemId:'btnPassword',
            action:'chgPassword',
            iconCls:'key',
            text:'Cambiar password',
            disabled:true
        }];
    }

});